//
//  RedViewController.m
//  Tabbar
//
//  Created by 吴志勇 on 2020/4/9.
//  Copyright © 2020 wzy. All rights reserved.
//

#import "RedViewController.h"
#import "ViewController.h"

@interface RedViewController ()

@end

@implementation RedViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor redColor];
    self.titleLabel.text = @"红色页面";
    
    
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeContactAdd];
    btn.frame = CGRectMake(40, 200, 40, 40);
    [btn addTarget:self action:@selector(click) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn];
}

//
- (void)click{
    [self.navigationController pushViewController:[[ViewController alloc]init] animated:YES];
}

-(void)dealloc{
    NSLog(@"红色销毁");
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
